<!DOCTYPE html>
<html>
<head>
	<title>代理开户</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
	<link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/0.4.3/weui.min.css">
	<style type="text/css">
		.hd_my{
			background-color: red;
			text-align: center;
			color: #fff;
		}
		.bottom_my{
			background-color: red;
			text-align: center;
			color: #fff;
			height: 35px;
			line-height: 35px;
			font-weight: bold;
			position: fixed; bottom: 0; left: 0; width: 100%;
		}
	</style>
</head>
<body>
<div class="hd hd_my">
	<h1 class="page_title">微销宝</h1>
</div>
<div class="weui_cells_title" style="text-align: center; padding: 5px 0;  ">
	<h1>代理开户</h1></div>
<div class="weui_cells weui_cells_form">
    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label">姓名</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input class="weui_input" name="username" type="text" placeholder="请输入姓名"/>
        </div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label">身份证号</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input class="weui_input" name="cid" type="number" placeholder="请输入身份证号"/>
        </div>
    </div>
    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label">手机号</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input class="weui_input" id="phone" name="phone" type="number" placeholder="请输入手机号"/>
        </div>
    </div>
    <!--
    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label">验证码</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input class="weui_input" type="number" placeholder="请输入验证码"/>
        </div>
        <div class="weui_cell_ft">
        	<a id="sendCodeBtn" href="javascript:;" class="weui_btn weui_btn_mini weui_btn_primary">获取验证码</a>
        </div>
    </div>
    -->
</div>	
<div class="weui_btn_area">
    <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips">提交</a>
</div>


<div class="hd bottom_my">
	<a href="broker.html" style="color: #fff;">个人主页</a>
</div>

</body>
	<!-- body 最后 -->
<script src="res/js/zepto.min.js"></script>
<script src="res/js/Validator.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	$(function(){
		// 为按钮绑定点击事件
		$("#sendCodeBtn").one("click", function(){
			register.sendCode();
		})
	})
	var register = {
		codeTimer : function(){
			// 2、将按钮的文字变为倒计时秒数
			setInterval(function(){
				register.waitTime = register.waitTime - 1;
				$("#sendCodeBtn").text("时效："+ register.waitTime + "秒");
				if(register.waitTime <= 0){
					// 移出定时器
					window.clearInterval(register.codeTimer());
					// 将按钮设置为可用
					$("#sendCodeBtn").removeClass("weui_btn_disabled");
					$("#sendCodeBtn").text("获取验证码");
					/**/
					// 为按钮绑定点击事件
					$("#sendCodeBtn").one("click", function(){
						register.sendCode();
					})
					register.waitTime = 100;
				}
			}, 1000);
		},
		waitTime : 100,
		sendCode : function(){
			var _phone = $("#phone").val();
			if(_phone =="" || !Validator.phone(_phone)){
				alert("请输入正确的手机号");
			}else{
				// 1、将获取验证码按钮设置为不可点击
				$("#sendCodeBtn").addClass("weui_btn_disabled");
				// 2、将按钮的文字变为倒计时秒数
				register.codeTimer();
				
				//alert("验证码是：123456");
			}
		}
	};
</script>
</html>
